using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace DataWinner.Entity.Nba_Sohu.Models.Mapping
{
    public class MatchCourse_SohuMap : EntityTypeConfiguration<MatchCourse_Sohu>
    {
        public MatchCourse_SohuMap()
        {
            // Primary Key
            this.HasKey(t => t.MatchCourseId);

            // Properties
            this.Property(t => t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.MatchCourseId)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.MatchId)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.HomeDescription)
                .HasMaxLength(100);

            this.Property(t => t.VisitingDescription)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("MatchCourse_Sohu");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.MatchCourseId).HasColumnName("MatchCourseId");
            this.Property(t => t.MatchId).HasColumnName("MatchId");
            this.Property(t => t.RowIndex).HasColumnName("RowIndex");
            this.Property(t => t.Section).HasColumnName("Section");
            this.Property(t => t.Time).HasColumnName("Time");
            this.Property(t => t.HomeDescription).HasColumnName("HomeDescription");
            this.Property(t => t.HomeScoring).HasColumnName("HomeScoring");
            this.Property(t => t.VisitingDescription).HasColumnName("VisitingDescription");
            this.Property(t => t.VisitingScoring).HasColumnName("VisitingScoring");
            this.Property(t => t.CreateBy).HasColumnName("CreateBy");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.ModifyBy).HasColumnName("ModifyBy");
            this.Property(t => t.ModifyTime).HasColumnName("ModifyTime");
            this.Property(t => t.IsDeleted).HasColumnName("IsDeleted");

            // Relationships
            this.HasRequired(t => t.Match_Sohu)
                .WithMany(t => t.MatchCourse_Sohu)
                .HasForeignKey(d => d.MatchId);

        }
    }
}
